//
//  EditDataPhotoCell.m
//  NiubilityProject
//
//  Created by Apple on 2017/11/29.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "EditDataPhotoCell.h"
#import "PhotoModel.h"

@implementation EditDataPhotoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.rmoveBtn.hidden = YES;
}
- (IBAction)removeClick:(UIButton *)sender {
    self.isHaveImage = NO;
    if (self.removeImage) {
        self.removeImage(self.indexPath);
    }
}
- (void)setPhotoModel:(PhotoModel *)photoModel{
    _isHaveImage = YES;
    self.rmoveBtn.hidden = !_isHaveImage;
    _photoModel = photoModel;
    if (photoModel.image) {
        self.imageView.image = photoModel.image;
    }else{
        [self.imageView setImageWithURL:[NSURL URLWithString:photoModel.src] options:YYWebImageOptionProgressiveBlur];
    }
}
-(void)setIsHaveImage:(BOOL)isHaveImage{
    _isHaveImage = isHaveImage;
    self.rmoveBtn.hidden = !_isHaveImage;
    if (isHaveImage) {
        
    }else{
        self.imageView.image =UIImageMake(@"me_addPhotoPlace");
    }

}
@end
